package com.ruoyi.web.controller.system;

import com.google.gson.Gson;
import com.ruoyi.system.Control.memberEnt;

import java.io.IOException;
import java.nio.file.Files;
import java.nio.file.Paths;



public class ReadJsonFile {




    // 读取json文件并解析为对象
    public static <T> T readJsonFile(String path, Class<T> valueType) {
        try {
            String jsonString = new String(Files.readAllBytes(Paths.get(path)));
            Gson gson = new Gson();
            return gson.fromJson(jsonString, valueType);
        } catch (IOException e) {
            e.printStackTrace();
        }
        return null;
    }

    public static void main(String[] args) throws IOException {


    }



}
